<!--<html> 
<head> 
<title>测试</title> 
</head> 
<body> 
<FORM METHOD=POST ACTION="login.php"> 
用户名：<INPUT TYPE="text" NAME="name"><br/> 
密码：<INPUT TYPE="password" name="pwd"><br/> 
<INPUT TYPE="submit" value="提交"> 
</FORM> 
</body> 
</html>-->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta charset="UTF-8">
    <title>登录注册</title>
    <link href='__PUBLIC__/css/bootstrap.min.css' rel="stylesheet">
    <script src='__PUBLIC__/js/jquery.min.js' type="text/javascript"></script>
    <script src='__PUBLIC__/js/bootstrap.min.js' type="text/javascript"></script>
</head>

<style>
    .content{
        float: right;
        width: 400px;
        margin-top: 100px;
        background:#fafafa;
    }
    .modal-content{
        width: 600px;
    }
    #che{
        padding-left: 160px;
    }
</style>


<script type="text/javascript">

    function login() {
        // console.info("点击了登录");
        var userName = document.getElementsByName('name')[0].value;
        // console.info(userName)
        var userPass = document.getElementsByName('password')[0].value; 
        // console.info(userPass);
        if (userName == "" || userName == null) {
            alert("用户名不能为空");
            return false;
        } else if (userPass == "" || userPass == null) {
            alert("密码不能为空");
            return false;
        } else {
            return true;
        }
    }

    $(document).ready(function() {
        // Generate a simple captcha
        function randomNumber(min, max) {
            return Math.floor(Math.random() * (max - min + 1) + min);
        };
        $('#captchaOperation').html([randomNumber(1, 100), '+', randomNumber(1, 200), '='].join(' '));

        $('#defaultForm').bootstrapValidator({
            //        live: 'disabled',

            captcha: {
                validators: {
                    callback: {
                        alert: 'Wrong answer',
                        callback: function(value, validator) {
                            var items = $('#captchaOperation').html().split(' '), sum = parseInt(items[0]) + parseInt(items[2]);
                            return value == sum;
                        }
                    }
                }
            }

        });

        // Validate the form manually
        $('#validateBtn').click(function() {
            $('#defaultForm').bootstrapValidator('validate');
        });

        $('#resetBtn').click(function() {
            $('#defaultForm').data('bootstrapValidator').resetForm(false);
        });
    });
    function change()
    {
        var search=document.getElementById('search').value;
        var bai="https://www.baidu.com/s?wd=";
        var du="&rsv_spt=1&rsv_iqid=0xe97675fb000043b6&issp=1&f=8&rsv_bp=0&rsv_idx=2&ie=utf-8&tn=baiduhome_pg&rsv_enter=1&rsv_sug3=7&rsv_sug1=6&rsv_sug7=101&rsv_t=227044TtS9qeVu8DAwk3ZSRFoH0OCKcFn7aK2yg0FtoXphUMxQ1ShqgoJUegsgxUMyh1&rsv_sug2=0&inputT=5449&rsv_sug4=5449"
        var baidu=bai+search+du;
        //window.location.href=baidu;
        window.open(baidu);
    }
</script>

<body>

        <nav class="nav navbar-default" role="navigation">

            <div class="container-fluid" style="background-color:#563d7c">
                <div class="navbar-header">
                    <button class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>

                </div>
                <div class="collapse navbar-collapse">
                    <ul class="nav navbar-nav">
                        <li class="active"><a href="home_page.html" class="navber-link">首页</a></li>
                        <li><a href="me.html" class="navber-link">个人资料</a></li>
                        <li><a href="#" class="navber-link">问题咨询</a></li>
                    </ul>
                    <div class="navbar-form navbar-right">
                        
                        <input type="text" class="form-control" placeholder="想知道什么" id="search">
                        <button class="btn btn-group" onclick="change()">搜  索</button>
                    </div>
                </div>
            </div>
        </nav>
        <div class="container" >
    <center><h1 class="page-header">用户登录</h1></center>
    <form class="form-horizontal" action="loginpost" METHOD="POST" onsubmit="return login()" id="form1">
        <div class="form-group">
            <div class="col-md-5">
                <input type="text" class="form-control" name="name"  placeholder="用户名/邮箱" style="position: relative;left: 330px">
            </div></div>
        <div class="form-group">
            <div class="col-md-5">
                <input type="password" name="password" class="form-control" placeholder="密码"  style="position: relative;left: 330px">
            </div></div>
        <div class="form-group"  style="position: relative;left: 130px">
            <label class="col-sm-3 control-label" style="color:#666666">验证码：</label>
            <label class="col-lg-2 control-label"style="color:#666666" id="captchaOperation"></label>
            <div class="col-lg-2">
                <input type="text" style="color:#666666"class="form-control" name="captcha" />
            </div>
        </div>
        <div class="form-group" >
            <div class="col-md-5">
            <a class="navbar-btn-" style="text-decoration: none; color:white" href="register.html">
            <input class="" type="button" style="position: relative;left: 450px;background-color: #f8f8f8;padding:10px 30px 10px 30px;border: 1px solid #f8f8f8;
                        text-decoration: none; color: #66666; border-radius:5px; background-color: #4daaff;" value="注册" ></a>
               <button class="btn-info"  type="submit" style="position: relative;left: 500px;background-color: #f8f8f8;
                        padding:10px 30px 10px 30px;border: 1px solid #f8f8f8;
                        text-decoration: none; color: #66666; border-radius:5px; background-color: #4daaff;">登陆</button>
               
            </div></div>
    </form></div>
<div class="modal fade in" id="mymodal" style="position:absolute">
        <div class="model-dialog" >
            <div class="modal-content center-block">
                <div class="modal-header">
                    <button class="close" data-dismiss="modal">&times;</button>
                </div>
                <div class="modal-body">
                    <form class="form-horizontal" action="login.html">

           <div class="form-group"style="position: relative;left: 130px">
               <div class="col-md-6">
                   <input type="text" class="form-control" placeholder="用户名/email">
               </div>
           </div>
           <div class="form-group" style="position: relative;left: 130px">
                        <div class="col-md-6">
                            <input type="text" class="form-control" placeholder="出生日期:年/月/日">
                        </div>
                    </div>
                        <div class="form-group" style="position: relative;left: 130px">
                            <div class="col-md-6"><input type="text" class="form-control" placeholder="家庭住址">
                            </div>
                        </div>
           <div class="form-group"style="position: relative;left: 130px">
               <div class="col-md-6">
                   <input type="password" class="form-control" placeholder="密码">
               </div>
           </div>
           <div class="form-group"style="position: relative;left: 130px">
               <div class="col-md-6">
                   <input type="password" class="form-control" placeholder="确认密码">
               </div>
           </div>
           <div class="form-group"style="position: relative;left: 130px">
               <div class="col-md-6">
                                <input type="password" class="form-control" placeholder="联系电话">
  </div></div>
                        <div class="form-group" style="position: relative; left: 100px" >
                            <label class="col-sm-3 control-label">性&nbsp;&nbsp;别：</label>
                            <div class="col-md-6">
                                <label class="radio-inline"> <input type="radio" name="optionsRadios" >男
                                </label>
                                <label class="radio-inline"><input type="radio" name="optionsRadios" >女
                                </label>
                            </div>

                        </div>
            <div class="form-group" style="position: relative;left: 40px">
                                     <div class="col-md-7">
                                         <label class="checkbox-inline" id="che"><input type="checkbox">我已阅读并同意<a href="" class="navbar-link">服务协议</a></label>
                                     </div>
                                 </div>
                                 <div class="form-group">
                                     <label class="col-sm-4"></label>
                                     <div class="col-md-3">
                                         <button type="submit" class="btn btn-primary" id="btn4">提交注册</button>
                                     </div>

                                 </div>
  </form>
   </div>
  </div>
    </div>
    </div>

</body>
</html>
 